package com.woniu.gf.pawn.shopweb.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.woniu.gf.pawn.comm.core.domain.Management;
import com.woniu.gf.pawn.shopweb.dao.ManagementMapper;
import com.woniu.gf.pawn.shopweb.service.IManagementService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author TL
 * @since 2020-10-13
 */
@Service
public class ManagementServiceImpl extends ServiceImpl<ManagementMapper, Management> implements IManagementService {

    @Autowired
    private ManagementMapper managementMapper;
    @Override
    public Management findManage(String query) {

        QueryWrapper<Management> wrapper = new QueryWrapper<>();
        wrapper.eq("management_name",query).or().eq("management_phone",query);
        Management managements = managementMapper.selectOne(wrapper);
        return managements;
    }

    @Override
    public Management findManagerById(Integer managerId) {
        return managementMapper.selectById(managerId);
    }
}
